package com.agile.leetcode.hutool.base64;

import cn.hutool.core.codec.Base64;
import cn.hutool.core.io.FileUtil;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/5/10 18:12
 */
public class Base64Decode {
    public static void main(String[] args) {
        String code = "iVBORw0KGgoAAAANSUhEUgAAAPAAAADZCAYAAAAe9r1sAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQ" +
                "AABJ0Ad5mH3gAACY/SURBVHhe7ZhRiiVJrkR7abO03tksrR96cx3Ohx/CVHLPvglhYBChazKZR5aDqL/+efHixa/Fe4FfvPjFeC/wix" +
                "e/GO8FfvHiF6N9gf/73//+8/fffx9leS7Q3+rkpJek3pD4m0/SSyYao/UmdYKaLm2WaQjqEw1JvWmMk96E9D+F9gWuIH/99ddRlucC/" +
                "a1OTnpJ6g2Jv/kkvWSiMVpvUieo6dJmmYagPtGQ1JvGOOlNSP9TeC/wh9QbEn/zSXrJRGO03qROUNOlzTINQX2iIak3jXHSm5D+pzC6" +
                "wP/5z3/+//1PWL27g9XzU51zuZaYhrOSekJbt2xNosY4yUlNvS/U81OvZa7fVq/RPElmI+u3BX4f6rv+1Hd9+B3qvdNrZIZ6P43RBZ4" +
                "…lP8yHMk7TeBOZPz66m23sbxy6wrSKkrSX1vND1oT5Zvagxlu4JSU5jktNoZ7c6SQ1BvWWz70YN/ev9SWM5LcOE9Kz3BTs7NfX8p723" +
                "cewCd9H1MT3rp5jkMUzy2Fx6TrIZJplJZjPPJP/tPJbBNJPe23gv8IZJHsMkj82l5ySbYZKZZDbzTPLfzmMZTDPpvY3RBZ6sN92VozQ" +
                "7fbKGGZP8ycpH2lybRf2NPEb61Duz7vLYucgkvzE5VzeDnbGr4dx638Ey0/8GRhf4FMvzCZzb1RvNx2YlnsZklnHSa6Sn+SQaI3uJZJ" +
                "YhyTCZO/En6JPoJ3gv8AY2K/E0JrOMk14jPc0n0RjZSySzDEmGydyJP0GfRD9B+wLbqjBhsmZwbldvNB+blXgak1nGSa+RnuaTaIzsJ" +
                "ZJZhiTDZO7En6BPop+gfYFfvHjxPXgv8IsXvxjvBX7x4hfjvcAvXvxivBf4xYtfi3/++T9s25ufidmNyAAAAABJRU5ErkJggg==";

        Base64.decodeToFile(code, FileUtil.file("E:\\a.jpg"));
        // 编码
        String encode = Base64.encode(FileUtil.file("E:\\czk.png"));
        System.out.println(encode);
    }
}
